import {Link,hashHistory} from "react-router";

import store from "../../store/store";

export default React.createClass({
	tiao:function(){
		//获取到input中的数据传送到数据库
		//console.log(this.refs.name.value)
		var action ={
		 	type :"ADD_SS",
		 	text :this.refs.name.value
		 }
		 store.dispatch(action)
		 hashHistory.push("/home/list/word="+this.refs.name.value)
	},
	fan:function(){
		hashHistory.goBack()
	},
	render: function(){
		return(
			<footer>
			 	<div className="ss_header_div"> 
				 <Link onClick={this.fan} className="iconfont home_fs_btn icon-fanhui"></Link>
					 <div>
						<a href="javascript:;" className = "iconfont fdl_btn icon-home_sousuo"></a>
						<input type="text" defaultValue="大益"  ref="name"/>
					</div>
					<a href="javascript:;" className="ss_r_btn" onClick={this.tiao}>搜索</a>
				 </div>
			 </footer>
		)
	}
})